﻿using System;
using System.Collections.Generic;
using System.Linq;
using System.Web;
using System.Web.Mvc;
using PhotogalleryModel;

namespace photogalleryMVC
{
    public static class RegisterModelErrorHelper
    {

        public static void RegisterErrors(this ICollection< ValidationError > errorList,ModelStateDictionary dictionary )
        {
            foreach (ValidationError error in errorList )
            {
                dictionary.AddModelError(error.ErrorTag, error.ErrorMessage);
            }
        }
    }
}